package cn.lili.controller;


import cn.lili.common.security.AuthUser;
import cn.lili.listener.UserMessageListener;
import cn.lili.modules.member.entity.dos.MemberSign;
import cn.lili.modules.member.entity.dos.User;
import cn.lili.modules.payment.entity.dto.UserPointUpdateDTO;
import cn.lili.modules.payment.entity.dto.UserWithdrawalMessage;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 用户消息重推
 *
 * @author liushuai(liushuai711 @ gmail.com)
 * @version v4.0
 * @Description:
 * @since 2023/4/14 16:39
 */
@RestController
@RequestMapping("/consumer/user")
@Api(tags = "异常用户消息API")
@RequiredArgsConstructor
public class UserMessageRePush {


    private final UserMessageListener userMessageListener;

    @ApiOperation(value = "用户注册")
    @GetMapping(value = "/userRegister")
    public void userRegister(User user) {
        userMessageListener.userRegister(user);
    }

    @ApiOperation(value = "用户登录")
    @GetMapping(value = "/userLogin")
    public void userLogin(AuthUser authUser) {
        userMessageListener.userLogin(authUser);
    }


    @ApiOperation(value = "用户签到")
    @GetMapping(value = "/userSign")
    public void userSign(MemberSign memberSign) {
        userMessageListener.userSign(memberSign);
    }

    @ApiOperation(value = "用户积分变更")
    @GetMapping(value = "/userPointChange")
    public void userPointChange(UserPointUpdateDTO userPointUpdateDTO) {
        userMessageListener.userPointChange(userPointUpdateDTO);
    }

    @ApiOperation(value = "用户提现")
    @GetMapping(value = "/userWithdrawal")
    public void userWithdrawal(UserWithdrawalMessage userWithdrawalMessage) {

        userMessageListener.userWithdrawal(userWithdrawalMessage);

    }
}
